// Created by liusc on 2020/9/17--11:17.
<template>
    <div class="margin-box">
        <list-page
            :pager="pager"
            :data="tableData"
            :showSelectSearch="false"
            :placeholder="placeholder"
            @searchByKey="searchByKey"
            @changePageSize="changePageSize"
            @changeCurrentPage="changeCurrentPage">
        >
            <template slot="buttons">
                <el-button size="small" v-if="add_button" type="primary" @click="toAddData()">新增</el-button>
            </template>

            <template slot="table">
                <el-table
                    :data="tableData"
                    align="center"
                    @selection-change="selectionChange"
                >
                    <!--                    <el-table-column type="selection" width="55"></el-table-column>-->
                    <el-table-column label="预算编号" prop="budgetCode">
                    </el-table-column>
                    <el-table-column label="申请名称" prop="applyName">
                    </el-table-column>
                    <el-table-column label="申请开始时间" prop="applyStart">
                    </el-table-column>
                    <el-table-column label="申请结束时间" prop="applyEnd">
                    </el-table-column>
                    <el-table-column label="备注" prop="remarks">
                    </el-table-column>
                    <el-table-column width="100px" label="操作">
                        <template slot-scope="scope">
                            <el-button
                                type="text"
                                v-if="
                                    scope.row.budgetType == 13 &&
                                        scope.row.isAmendment == 0
                                "
                                @click="toEditData(scope)"
                                >编辑</el-button
                            >
                            <el-button
                                type="text"
                                v-if="scope.row.budgetType == 13
                                "
                                @click="toLookData(scope)"
                            >查看</el-button>
                            <!--                            <el-button type="text" @click="deleteRow(scope)">-->
                            <!--                                <span class="text-danger">删除</span>-->
                            <!--                            </el-button>-->
                        </template>
                    </el-table-column>
                </el-table>

                <initiateAdd
                    ref="initiateAddInfo"
                    @addData="addData"
                    @query="getListData"
                ></initiateAdd>
                <initiateEdit
                    ref="initiateEditInfo"
                    @updateData="updateData"
                    @query="getListData"
                ></initiateEdit>
                <initiateLook
                    ref="initiateLookInfo"
                    @query="getListData"
                ></initiateLook>
            </template>
        </list-page>
    </div>
</template>

<script src="./addition_list.js"></script>
<style scoped lang="scss">
@import "./addition_list";
</style>
